package com.qf.flash.ui.home;

import android.app.Activity;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.qf.flash.R;
import com.qf.flash.constant.Constant;
import com.qf.flashlib.base.BaseActivity;

import butterknife.BindView;
import butterknife.OnClick;

import static com.qf.flash.utils.MyUtil.goGroupChat;

/**
 * 创建日期：2020/3/9 on 21:13
 * 描述:
 * 作者:戴旭东
 */
public class BusinessSuccessActivity extends BaseActivity {


    @BindView(R.id.tv_top_title)
    TextView tvTopTitle;
    private String emchatId;
    public static void start(Activity activity,String emchatId) {
        Intent intent = new Intent(activity, BusinessSuccessActivity.class);
        intent.putExtra("emchatId", emchatId);
        activity.startActivity(intent);
    }


    @Override
    protected int getLayoutId() {
        return R.layout.activity_business_suc;
    }

    @Override
    protected void initViewAndData() {
        tvTopTitle.setText("选择商家");
         emchatId = getIntent().getStringExtra("emchatId");
    }


    @OnClick({R.id.tv_top_back, R.id.tv_gon_chat})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_top_back:
                finish();
                break;
            case R.id.tv_gon_chat:
//                HomeActivity.start(this, 2);
                if (!TextUtils.isEmpty(emchatId))
                goGroupChat(BusinessSuccessActivity.this, Constant.CHATTYPE_GROUP, emchatId);
                break;
        }
    }
}
